package com.bridgeintelligent.tag.webserver.workflow;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Objects;

@Getter
@Setter
@Accessors(chain = true)
public class Instance {
    private String id;
    private String owner;
    private String resource;
    private boolean deleted;
    private String workflowId;
    private int nodeOrder;
    private String updateDate;
    private int currentStatus;
    private String desc;

    private String workflowName;

    private Node node;
    private List<History> histories;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Instance)) {
            return false;
        }
        Instance instance = (Instance) o;
        return getId().equals(instance.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }
}
